<resultMap id="{{statementName}}" type="{{entityType}}">
    {{#results}}
        <{{#primaryKey}}id{{/primaryKey}}{{^primaryKey}}result{{/primaryKey}} property="{{property}}" column="{{column}}" {{#javaType}}javaType="{{javaType}}"{{/javaType}} {{#jdbcType}}jdbcType="{{jdbcType}}"{{/jdbcType}} {{#typeHandler}} typeHandler="{{typeHandler}}"{{/typeHandler}} />
    {{/results}}
    {{#embeddedAssociations}}
        <association property="{{property}}"{{#javaType}}
                     javaType="{{javaType}}"{{/javaType}}>
            {{#results}}
                <{{#primaryKey}}id{{/primaryKey}}{{^primaryKey}}result{{/primaryKey}}
                        property="{{property}}" column="{{column}}"
                        {{#javaType}}javaType="{{javaType}}"{{/javaType}}
                    {{#jdbcType}}jdbcType="{{jdbcType}}"{{/jdbcType}}
                    {{#typeHandler}} typeHandler="{{typeHandler}}"{{/typeHandler}}
                />
            {{/results}}
        </association>
    {{/embeddedAssociations}}
    {{#associations}}
        <association property="{{property}}" javaType="{{javaType}}" fetchType="{{fetch}}"
                     select="{{select}}" column="{ {{#joinColumns}}{{^-first}},{{/-first}}{{name}}={{name}}{{/joinColumns}} }"/>
    {{/associations}}
    {{#collections}}
    <collection property="{{property}}"
                ofType="{{ofType}}"
                select="{{select}}"
            column="{ {{^manyToMany}}{{#joinColumns}}{{^-first}},{{/-first}}{{referencedColumnName}}={{referencedColumnName}}{{/joinColumns}}{{/manyToMany}}{{#manyToMany}}{{#joinTable.joinColumns}}{{^-first}},{{/-first}}{{referencedColumnName}}={{referencedColumnName}}{{/joinTable.joinColumns}}{{/manyToMany}} }"
        fetchType="{{fetch}}"></collection>
    {{/collections}}
</resultMap>

